#pragma once

/*opcode*/
#define nop					0
#define aconst_null			1 
#define iconst_m1			2 
#define iconst_0			3 
#define iconst_1			4 
#define iconst_2			5 
#define iconst_3			6 
#define iconst_4			7 
#define iconst_5			8 
#define lconst_0			9 
#define lconst_1			10 
#define fconst_0			11 
#define fconst_1			12 
#define fconst_2			13 
#define dconst_0			14 
#define dconst_1			15 
#define bipush				16 
#define sipush				17 
#define ldc					18 
#define ldc_w				19 
#define ldc2_w				20 
#define iload				21 
#define lload				22 
#define fload				23 
#define dload				24 
#define aload				25 
#define iload_0				26 
#define iload_1				27 
#define iload_2				28 
#define iload_3				29 
#define lload_0				30 
#define lload_1				31 
#define lload_2				32 
#define lload_3      33 
#define fload_0      34 
#define fload_1      35 
#define fload_2      36 
#define fload_3      37 
#define dload_0      38 
#define dload_1      39 
#define dload_2      40 
#define dload_3      41 
#define aload_0      42 
#define aload_1      43 
#define aload_2      44 
#define aload_3      45 
#define iaload       46 
#define laload       47 
#define faload       48 
#define daload       49 
#define aaload       50 
#define baload       51 
#define caload       52 
#define saload       53 
#define istore       54 
#define lstore       55 
#define fstore       56 
#define dstore       57 
#define astore       58 
#define istore_0     59 
#define istore_1     60 
#define istore_2     61 
#define istore_3     62 
#define lstore_0     63 
#define lstore_1     64 
#define lstore_2     65 
#define lstore_3     66 
#define fstore_0     67 
#define fstore_1     68 
#define fstore_2     69 
#define fstore_3     70 
#define dstore_0     71 
#define dstore_1     72 
#define dstore_2     73 
#define dstore_3     74 
#define astore_0     75 
#define astore_1     76 
#define astore_2     77 
#define astore_3     78 
#define iastore      79 
#define lastore      80 
#define fastore      81 
#define dastore      82 
#define aastore      83 
#define bastore      84 
#define castore      85 
#define sastore      86 
#define pop          87 
#define pop2         88 
#define  dup         89
#define  dup_x1      90
#define  dup_x2      91
#define  dup2        92
#define  dup2_x1     93
#define  dup2_x2     94
#define  swap        95
#define  iadd        96
#define  ladd        97
#define  fadd        98
#define  dadd        99
#define  isub        100
#define  lsub        101
#define  fsub        102
#define  dsub        103
#define  imul        104
#define  lmul        105
#define  fmul        106
#define  dmul        107
#define  idiv        108
#define  ldiv        109
#define  fdiv        110
#define  ddiv        111
#define  irem        112
#define  lrem        113
#define  frem        114
#define  drem        115
#define	 ineg		 116
#define  lneg        117
#define  fneg        118
#define  dneg        119
#define  ishl        120
#define  lshl        121
#define  ishr        122
#define  lshr        123
#define  iushr       124
#define  lushr       125
#define  iand        126
#define  land        127
#define  ior         128
#define  lor         129
#define  ixor        130
#define  lxor        131
#define  iinc        132
#define  i2l         133
#define  i2f         134
#define  i2d         135
#define  l2i         136
#define  l2f         137
#define  l2d         138
#define  f2i         139
#define  f2l         140
#define  f2d         141
#define  d2i         142
#define  d2l         143
#define  d2f         144
#define  i2b         145
#define  i2c         146
#define  i2s         147
#define  lcmp        148
#define  fcmpl       149
#define  fcmpg       150
#define  dcmpl       151
#define  dcmpg       152
#define  ifeq        153
#define  ifne        154
#define  iflt        155
#define  ifge        156
#define  ifgt        157
#define  ifle        158
#define  if_icmpeq   159
#define  if_icmpne   160
#define  if_icmplt   161
#define  if_icmpge   162
#define  if_icmpgt   163
#define  if_icmple   164
#define  if_acmpeq   165
#define  if_acmpne			166
#define  OP_goto			167
#define  jsr				168
#define  ret				169
#define  tableswitch		170
#define  lookupswitch		171
#define  ireturn			172
#define  lreturn			173
#define  freturn			174
#define  dreturn			175
#define  areturn			176
/*it same as C key, so I add prefix OP_*/
#define  OP_return			177
#define  getstatic			178
#define  putstatic			179
#define  getfield			180
#define  putfield			181
#define  invokevirtual		182
#define  invokespecial		183
#define  invokestatic		184
#define  invokeinterface	185
#define  xxxunusedxxx1		186
#define  OP_new				187
#define  newarray			188
#define  anewarray			189
#define  arraylength		190
#define  athrow				191
#define  checkcast			192
#define  instanceof			193
#define  monitorenter		194
#define  monitorexit		195
#define  wide				196
#define  multianewarray		197
#define  ifnull				198
#define  ifnonnull			199
#define  goto_w				200
#define  jsr_w				201
#define  breakpoint			202
#define  impdep1			254
#define  impdep2			255

#include "Class.h"
#include "method.h"
#include "frame.h"
void ExecuteEngine(Class *javaClass, Method *method, Frame* &frame);